package example;

public class ArrayHolder {

	private Object[] array;
	private int index;

	public ArrayHolder() {
		this.array = new Object[4];
		this.index = 0;
	}

	public void addObject(Object o) throws Exception {
		if (index == array.length) {
			throw new Exception("Full Array!");
		}
		this.array[index++] = o;
	}

	/*
	public void removeLastObject() throws Exception {
		if (index == 0) {
			throw new Exception("Empty Array!");
		}
		this.array[--index] = null;
	}
	
	public int getObjectCount() {
		return index;
	}*/

}
